#include<bits/stdc++.h>
using namespace std;

string s[1000];

int main()
{
	int k = 0;
	while(cin>>s[k] && s[k++] != "\n");
	for(int i = k-1;i >= 0;i--)
		cout<<s[i]<<" ";
    return 0;
}

